﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FeedBack {
    class DownloaderFactory {
        public IDownloader Create(Story story) {
            if ((story.Link != null && 
                (story.Link.DnsSafeHost.Contains("youtube.com") ||
                story.Link.DnsSafeHost.Contains("youtu.be"))) ||
                (story.Source != null && story.Source.DnsSafeHost.Contains("youtube.com"))) {
                return new YouTubeDownloader();
            }
            else {
                return new DefaultVideoDownloader();
            }
        }
    }
}
